package com.sdzee.test;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UpdateEvt extends HttpServlet {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;	
	

	public void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException{
		
		this.getServletContext().getRequestDispatcher( "/WEB-INF/Evt.jsp" ).forward( request, response );
	}
	
	public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException {
		
		String titre=request.getParameter("Titre");		
		String description=request.getParameter("Description");		
		String adresse=request.getParameter("Adresse");
		String categorie=request.getParameter("Categorie");
		 System.out.println(titre);
		 System.out.println(categorie);
		
		 for (int i=1;i<11;i++){			 

			 System.out.println(i);
			 String evt=titre+"/"+description+"/"+adresse+"/"+categorie;
				
				MySQLAccessEvt daoEvt= new MySQLAccessEvt();
				try {
					daoEvt.insertDataBase(evt);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
			 
		 }
		
		
		this.getServletContext().getRequestDispatcher( "/WEB-INF/Evt.jsp" ).forward( request, response );
	}
}
	
